<%@ page language="java"  contentType="text/html; charset=utf-8"%>
<%
    String path =request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	request.setCharacterEncoding("utf-8");//解决中文乱码问题，无法解决URL传递中文参数的乱码问题
	String username="";
	String password="";
	username=request.getParameter("username");
	password=request.getParameter("password") ;
    //如果用户名和密码都是admin，则登录成功
    if("admin".equals(password ) && "admin".equals(username)) 
    {
    	session.setAttribute("loginUser",username);
    	request.getRequestDispatcher("login_success.jsp").forward(request, response);
    }
    else
    {
    	response.sendRedirect("login_fail.jsp");
    }
    
    
%>

<body>

<% 
out.println(username);
    out.println(password);
%>
   
</body>

